package com.huawei.gamebox.plugin.gameservice.newsinfo.card;

import android.content.Context;
import android.view.View;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.gamebox.plugin.gameservice.newsinfo.bean.NewsInfoBean;
import com.huawei.gamebox.plugin.gameservice.newsinfo.bean.NewsInfoWithTitleBean;
import com.huawei.gamebox.service.common.cardkit.card.BaseGsCard;
import com.huawei.gamebox.service.welfare.common.card.GsTitleCard;
import java.util.ArrayList;
import java.util.List;
import o.cgz;

public class NewsInfoWithTitleCard extends BaseGsCard {
    private GsTitleCard ˊ = null;
    private List<BaseGsCard> ˋ = new ArrayList();

    public /* synthetic */ cgz ˏ(View view) {
        return ˋ(view);
    }

    public NewsInfoWithTitleCard(Context context) {
        super(context);
    }

    public GsTitleCard ˊ() {
        return this.ˊ;
    }

    public void ˎ(GsTitleCard gsTitleCard) {
        this.ˊ = gsTitleCard;
    }

    public BaseGsCard ˋ(View view) {
        ʽ(view);
        return this;
    }

    public BaseGsCard ˊ(int i) {
        if (this.ˋ == null || i < 0 || i >= this.ˋ.size()) {
            return null;
        }
        return (BaseGsCard) this.ˋ.get(i);
    }

    public void ˋ(BaseGsCard baseGsCard) {
        if (baseGsCard != null) {
            this.ˋ.add(baseGsCard);
        }
    }

    public int ˋ() {
        return this.ˋ.size();
    }

    public void ˏ(CardBean cardBean) {
        int size;
        cardBean = (NewsInfoWithTitleBean) cardBean;
        if (this.ˊ != null) {
            this.ˊ.ˏ(cardBean);
        }
        if (cardBean.ॱ() != null) {
            size = cardBean.ॱ().size();
        } else {
            size = 0;
        }
        for (int i = 0; i < ˋ(); i++) {
            NewsInfoCard newsInfoCard = (NewsInfoCard) ˊ(i);
            if (newsInfoCard != null) {
                if (i >= size) {
                    newsInfoCard.ˉ().setVisibility(8);
                } else {
                    newsInfoCard.ˉ().setVisibility(0);
                    CardBean cardBean2 = (NewsInfoBean) cardBean.ॱ().get(i);
                    cardBean2.ˋˋ(cardBean.ॱˉ());
                    newsInfoCard.ˏ(cardBean2);
                }
            }
        }
    }
}
